<!DOCTYPE html>
<html xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>事件绑定</title>
    <script src="./lib/vue.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div id="app">
    <div id="example-1">
        <!--    监听事件 start-->
        <button v-on:click="counter += 1"> 数值 : {{ counter }}</button>
        <br/>
        <!--    监听事件 end-->
        <!--    事件处理方法 start-->
        <button v-on:dblclick="greet('abc', $event)">Greet</button>
        <!--    事件处理方法 end-->
    </div>
</div>
<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data: {
            counter: 0,
            name: "vue"
        },
        methods: {
            greet: function (str, e) {
                alert(str);
                console.log(e);
            }
        }
    });
</script>
<style type="text/css">

</style>
</body>
</html>
